# Building

## Needed tools

- A C99 compiler (like [GCC](https://gcc.gnu.org/) and [Clang](http://clang.llvm.org/))
- [make](https://en.wikipedia.org/wiki/Make_%28software%29)
- [CMake](https://cmake.org/)

## Needed libraries

### Standard library

Of course, you need a C99 standard library.
But if you have a C99 compiler, you have probably corresponding standard library.
Otherwise, we advise you to use [GNU's one](https://www.gnu.org/software/libc/).

### Check for unit tests

[Check](https://libcheck.github.io/check/) is used for unit tests.
On GNU/Linux, your distribution might have a package.
If you are running on Debian or Trisquel GNU/Linux, with SuperUser rights, you can install the library with `apt-get install check`.
You can also download and compile it with `make static-libs`, but a clean installation on your system would be better.

## Steps

0. `make static-libs # if needed`
1. `mkdir -p build`
2. `cd build`
3. `cmake ..`
4. `make`

## Operating System tested

- GNU/Linux
  - [Trisquel GNU/Linux](https://trisquel.info/) 7 "Belenos"
  - [Debian](https://www.debian.org/) GNU/Linux 8 "Jessie"
  - Ubuntu GNU/Linux 14.04 LTS

## Tests

Some tests are done with [cppcheck](http://cppcheck.sourceforge.net/), [vera++](https://bitbucket.org/verateam/vera/wiki/Home) and [splint](http://splint.org/).
A test is done with [valgrind](http://valgrind.org/).
Unit tests are done with Check.
To test all of them, you can use `make tests`.

## Continuous Integration

- [GitLab CI](.gitlab-ci.yml)
- [Travis CI](.travis.yml)
- [Magnum CI](.magnum.yml)
